package org.hwadee.entity;

import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class Comment {
    /* 评论ID */
    private Integer commentId;
    /* 上级评论ID */
    private Integer commentPid;
    /* 评论文章ID */
    private Integer commentPostId;
    /* 评论作者名 */
    private String commentAuthorName;
    /* 评论内容 */
    private String commentContent;
    /* 评论创建时间 */
    private Date commentCreateTime;
    /* 评论用户ID */
    private Integer commentUserId;
    /* 非数据库字段 */
    private Post post;
    private Comment parentComment;

    public Comment getParentComment() {
        return parentComment;
    }

    public void setParentComment(Comment parentComment) {
        this.parentComment = parentComment;
    }

    /**
     * 评论状态
     * 0表示评论已删除，1表示评论未删除
     */
    private Integer commentStatus;

    public Comment() {
    }

    public Comment(Integer commentId, Integer commentPid, Integer commentPostId, String commentAuthorName, String commentContent, Date commentCreateTime, Integer commentUserId, Post post, Integer commentStatus) {
        this.commentId = commentId;
        this.commentPid = commentPid;
        this.commentPostId = commentPostId;
        this.commentAuthorName = commentAuthorName;
        this.commentContent = commentContent;
        this.commentCreateTime = commentCreateTime;
        this.commentUserId = commentUserId;
        this.post = post;
        this.commentStatus = commentStatus;
    }

    public Integer getCommentId() {
        return commentId;
    }

    public void setCommentId(Integer commentId) {
        this.commentId = commentId;
    }

    public Integer getCommentPid() {
        return commentPid;
    }

    public void setCommentPid(Integer commentPid) {
        this.commentPid = commentPid;
    }

    public Integer getCommentPostId() {
        return commentPostId;
    }

    public void setCommentPostId(Integer commentPostId) {
        this.commentPostId = commentPostId;
    }

    public String getCommentAuthorName() {
        return commentAuthorName;
    }

    public void setCommentAuthorName(String commentAuthorName) {
        this.commentAuthorName = commentAuthorName;
    }

    public String getCommentContent() {
        return commentContent;
    }

    public void setCommentContent(String commentContent) {
        this.commentContent = commentContent;
    }

    public Date getCommentCreateTime() {
        return commentCreateTime;
    }

    public void setCommentCreateTime(Date commentCreateTime) {
        this.commentCreateTime = commentCreateTime;
    }

    public Integer getCommentUserId() {
        return commentUserId;
    }

    public void setCommentUserId(Integer commentUserId) {
        this.commentUserId = commentUserId;
    }

    public Post getPost() {
        return post;
    }

    public void setPost(Post post) {
        this.post = post;
    }

    public Integer getCommentStatus() {
        return commentStatus;
    }

    public void setCommentStatus(Integer commentStatus) {
        this.commentStatus = commentStatus;
    }

    @Override
    public String toString() {
        return "Comment{" +
                "commentId=" + commentId +
                ", commentPid=" + commentPid +
                ", commentPostId=" + commentPostId +
                ", commentAuthorName=" + commentAuthorName +
                ", commentContent='" + commentContent + '\'' +
                ", commentCreateTime=" + commentCreateTime +
                ", commentUserId=" + commentUserId +
                ", post=" + post +
                ", commentStatus=" + commentStatus +
                '}';
    }
}
